package ch.zbw.pra.sysventory.database.mapper;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import ch.zbw.pra.sysventory.model.Nic;

/**
 * Mapping von einem Resultset auf ein Nic Objekt
 * 
 * @author Roberto Lucas
 */

public class NicMapper implements RowMapper<Nic>,Serializable {

	private static final long serialVersionUID = -5735228791311388451L;

	public Nic mapRow(ResultSet rs, int rowNum) throws SQLException {
		Nic nic = new Nic();
		nic.setNicId(rs.getInt("nicId_pk"));
		nic.setNameNic(rs.getString("nicName"));
		nic.setIpv4Nic(rs.getString("nicIP4"));
		nic.setIpv6Nic(rs.getString("nicIP6"));
		nic.setMacAdressNic(rs.getString("nicMACAddress"));
		nic.setStandardGatewayNic(rs.getString("nicStandardGW"));
		nic.setDhcpNic(rs.getString("nicDHCP"));
		nic.setSubnetNic(rs.getString("nicSubnet"));		
		return nic;
	}


}
